package com.zdy.im.user;

import com.zdy.im.common.SpringContextHolder;
//import com.zdy.im.user.entity.ImUser;
//import com.zdy.im.user.service.IImUserService;
//import com.zdy.im.user.service.impl.ImUserServiceImpl;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;

/**
 * 用户 Utils 类
 * @Author 作者 : zdy
 * @CreateDate 创建时间: 2021-02-30
 */
public class UserUtils {

    /*private static IImUserService userService = SpringContextHolder.getBean(ImUserServiceImpl.class);

    *//**
     * 从系统中读取用户
     *
     * @return 用户信息
     *//*
    public static ImUser getUser() {
        UserDetails userDetails = (UserDetails) SecurityContextHolder.getContext()
                .getAuthentication()
                .getPrincipal();
        return userService.getByLoginName(userDetails.getUsername());
    }

    *//**
     * 获取用户id
     * @param id id
     * @return 结果
     *//*
    public static ImUser getUser(String id) {
        return userService.getById(id);
    }*/
}
